import { message } from 'ant-design-vue';

import { checkNameForm, checkCount } from "./formRuler";
import { ref } from "vue";
const selectContentList = ref([
  { value: true, name: '选项一', check: false, },
  { value: false, name: '选项二', checked: false }
])
// isBoolean:true, // 是否为Boolean类型, 参数是否必须为boolen类型，不是根据options个数判断，是根据后台字段类型要求判断

const itemForm = [
  {
    value: '',
    type: 'multiImgUploadSettings',
    id: '',
    children: [
      {
        value: '多图上传',
        placeholder: '请输入',
        param: 'label',
        rule: {
          required: true,
          //validator: checkNameForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '组件标题不能重复!',
          api: "fetchOssNameUnique",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "组件标题:",
        beforeText: '',
        afterText: '',
        width: '',
        showCount: false,
        disable: true,
        marginLeft: 0,
        marginTop: 0,
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
      {
        value: 'multiImgUpload',
        placeholder: '请输入',
        param: 'param',
        rule: {
          required: true,
          //validator: checkNameForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '组件标签不能重复!',
          api: "fetchOssNameUnique",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "组件标签:",
        beforeText: '',
        afterText: '',
        width: '',
        showCount: false,
        disable: true,
        marginLeft: 0,
        marginTop: 0,
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'helpMsg',
        rule: {
          required: false,
          //validator: checkNameForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '帮助信息不能重复!',
          api: "fetchOssNameUnique",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "帮助信息:",
        beforeText: '',
        afterText: '',
        width: '',
        showCount: false,
        disable: true,
        marginLeft: 0,
        marginTop: 0,
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'imgSuggest',
        rule: {
          required: false,
          //validator: checkNameForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '图片建议宽高不能重复!',
          api: "fetchOssNameUnique",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "图片建议宽高:",
        minBeforeText: '宽',
        maxBeforeText: '高',
        minAfterText: 'PX',
        maxAfterText: 'PX',
        width: '',
        showCount: false,
        disable: true,
        marginLeft: 0,
        marginTop: 16,
        type: 'mulNumberInput',
        associated: '',
        associatedValue: '',
        showTip: true,
        showTipText: '多图'
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'maxCount',
        rule: {
          required: false,
          validator: checkCount,
          trigger: ["blur"],
          message: '',
          // api: "fetchOssNameUnique",
          // key: 'siteDomain',
          // params: {}, //校验传参
        },
        label: "",
        beforeText: '最多上传图片',
        afterText: '张',
        width: '',
        showCount: false,
        disable: true,
        marginLeft: 0,
        marginTop: 16,
        type: 'numberInput',
        associated: 'imgSuggest',
        associatedValue: '',
        tips: '不填则不限制'
      },
      {
        value: true,
        param: 'description',
        rule: {
          required: false,
          //validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "图片描述:",
        marginLeft: 0,
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['允许图片添加描述', '不允许图片添加描述'],
        tips: '',
      },
      {
        value: false,
        param: 'rule',
        rule: {
          required: false,
          //validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否必填:",
        marginLeft: 0,
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
    ]
  },
]
export { itemForm, selectContentList }